from django.urls import path

from .views import PositionInfo, getParentClassify, createTemplate, ReadTemplate,GetTemplateViews,\
    ProjectListsView,StorageMessages,StorageRemovals,AllTemplate,Test,Daoru,UpdateTemplate,delTemplate

from rest_framework import routers

from api.Department.view import DepartmentView
from api.Position.view import PositionView
from api.People.view import PeopleView,People2

# from api.Jurisdiction.view import JurisdictionView
from api.Project.view import ProjectView
from api.ProjectMaterials.view import ProjectMaterialsView
from api.MaterialsClassify.view import MaterialsClassifyView
from api.ProjectList.view import ProjectListView
from api.Store.view import StoreView
from api.GoodsDetail.view import GoodsDetailView
from api.Template.view import TemplateView
from api.Log.view import LogView, logSelete

from django.urls import path
from .views import Register,storeMaterials
urlpatterns = [
    # path('department', DepartmentView.as_view()),
    # path('positionInfo', PositionInfo.as_view()),
    path('getParentClassify', getParentClassify),
    path('createTemplate', createTemplate),
    path('ReadTemplate', ReadTemplate),
    path("logData", logSelete),
    path("delTemplate", delTemplate),
    path("UpdateTemplate", UpdateTemplate.as_view()),
    # 库存数据
    path("Store",Register.as_view()),

    # 库存材料
    path("Store_Materials",storeMaterials.as_view()),

    #关联模板列表
    path("GetTemplate",GetTemplateViews.as_view()),
    #工程列表
    path("ProjectList",ProjectListsView.as_view()),


    path("peoplea",People2.as_view()),

    # 获取入库信息
    path("storage_messages",StorageMessages.as_view()),
    # 出库数据信息
    path("storage_removals",StorageRemovals.as_view()),
    path("AllTemplate", AllTemplate),
    path("test",Test.as_view()),
    path("daoru",Daoru.as_view())
]
router = routers.DefaultRouter(trailing_slash=False)  # 取消url地址后面的 /

router.register('people', PeopleView, basename='People')  # 人员管理
router.register('positionInfo', PositionView, basename='Position')  # 职位管理
# router.register('Jurisdiction', JurisdictionView, basename='Jurisdiction')  # 权限
router.register('department', DepartmentView, basename='Department')  # 部门管理
router.register('Project', ProjectView, basename='Project')  # 工程项目
router.register('ProjectMaterials', ProjectMaterialsView, basename='ProjectMaterials')  # 工程材料
router.register('MaterialsClassify', MaterialsClassifyView, basename='MaterialsClassify')  # 材料分类表
# router.register('ProjectList', ProjectListView, basename='ProjectList')  # 工程列表
# router.register('Store', StoreView, basename='Store')  # 库存管理
router.register('GoodsDetail', GoodsDetailView, basename='GoodsDetail')  # 商品明细
router.register('Template', TemplateView, basename='Template')  # 模板管理
router.register('Log', LogView, basename='Log')  # 日志
urlpatterns += router.urls

